package com.fundcrawler.entity;

import lombok.*;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 业务参数
 */
@Entity
@Table(name = "biz_param",
       indexes = {
           @Index(name = "idx_param_code_group", columnList = "param_code,param_group", unique = true)
       }
//       ,uniqueConstraints = @UniqueConstraint(columnNames = {"param_code","param_group"})
)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode
public class BizParam {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "param_code", nullable = false, columnDefinition = "VARCHAR(128) COMMENT '参数码'")
    private String paramCode;

    @Column(name = "param_group", nullable = false, columnDefinition = "VARCHAR(128) DEFAULT 'DEFAULT_GROUP' COMMENT '参数码'")
    private String paramGroup;

    @Column(name = "param_value", nullable = false, columnDefinition = "VARCHAR(512) COMMENT '参数值'")
    private String paramValue;

    @Column(name = "param_desc", columnDefinition = "VARCHAR(512) COMMENT '参数描述'")
    private String paramDesc;
}
